home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / OCETemplates.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  87.2 KB  |  1,807 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OCETemplates.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __OCETEMPLATES__
  19. #define __OCETEMPLATES__
  20.  
  21. #ifndef REZ
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25. #ifndef __EVENTS__
  26. #include <Events.h>
  27. #endif
  28.  
  29. #endif /* REZ */
  30. #ifndef __OCE__
  31. #include <OCE.h>
  32. #endif
  33.  
  34. #ifndef REZ
  35. #ifndef __OCESTANDARDMAIL__
  36. #include <OCEStandardMail.h>
  37. #endif
  38.  
  39.  
  40.  
  41. #if PRAGMA_ONCE
  42. #pragma once
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT
  50. #pragma import on
  51. #endif
  52.  
  53. #if PRAGMA_STRUCT_ALIGN
  54.     #pragma options align=mac68k
  55. #elif PRAGMA_STRUCT_PACKPUSH
  56.     #pragma pack(push, 2)
  57. #elif PRAGMA_STRUCT_PACK
  58.     #pragma pack(2)
  59. #endif
  60.  
  61. #endif /* REZ */
  62.  
  63.  
  64. /************************************************************************************************
  65.  ********************************* Template Resource Constants: *********************************
  66.  ************************************************************************************************/
  67.  
  68.  
  69. /* Current versions of all the different template types: */
  70.  
  71. #define kDETAspectVersion        -976
  72. #define kDETInfoPageVersion        -976
  73. #define kDETKillerVersion        -976
  74. #define kDETForwarderVersion    -976
  75. #define kDETFileTypeVersion        -976
  76.  
  77.  
  78. /*    'Normal' separation for template IDs within the file (this is just a suggestion; you can use whatever
  79.     separation you like, so long as two separate templates don't have overlapping resources): */
  80. #define kDETIDSep 250
  81.  
  82. /* A few predefined base IDs (again, just suggestions): */
  83. #define kDETFirstID        (1000)
  84. #define kDETSecondID    (1000+kDETIDSep)
  85. #define kDETThirdID        (1000+2*kDETIDSep)
  86. #define kDETFourthID    (1000+3*kDETIDSep)
  87. #define kDETFifthID        (1000+4*kDETIDSep)
  88.  
  89.  
  90.  
  91. /*    Templates consist of a set of associated resources, at constant offsets from a 'base ID' set by the
  92.     signature resource of the template. In the case of aspect templates, most of the resources in the
  93.     template are accessible from the template as property default values. The property number is the same
  94.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  95.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  96.     
  97.     All templates include the following resource fork resources:
  98.  
  99.      Type    Offset                        Description
  100.      ----    ------                        -----------
  101.     'rstr'    kDETTemplateName            Contains the name of the template
  102.  
  103. */
  104.  
  105. #define kDETTemplateName 0
  106.  
  107. /*    Aspects, info-pages, and forwarders include the following as well:
  108.  
  109.      Type    Offset                        Description
  110.      ----    ------                        -----------
  111.     'rstr'    kDETRecordType                Contains the type of record this applies to
  112.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  113.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  114.  
  115. */
  116.  
  117. #define kDETRecordType                1
  118. #define kDETAttributeType            2
  119. #define kDETAttributeValueTag        3
  120.  
  121.  
  122.  
  123. /* ************************************ Aspects */
  124.  
  125. /*    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  126.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  127.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  128.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  129.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  130.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  131.     'detb' corresponds to kDETPrTypeBinary.
  132.  
  133.  
  134.  
  135.      Type    Offset                        Description
  136.      ----    ------                        -----------
  137.     'deta'    0                            Identifies the type of resource
  138.     'detc'    kDETCode                    Is the code resource, if any is used
  139.     'ICN#'    kDETAspectMainBitmap
  140.     'icl8'    kDETAspectMainBitmap
  141.     'icl4'    kDETAspectMainBitmap
  142.     'ics#'    kDETAspectMainBitmap
  143.     'ics8'    kDETAspectMainBitmap
  144.     'ics4'    kDETAspectMainBitmap
  145.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  146.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  147.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  148.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  149.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  150.                                         another template; if no other template provides an external name for a given internal
  151.                                         category, the internal name is used as the external name (main aspect only)
  152.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  153.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  154.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  155.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  156.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  157.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  158.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  159.                                         property # times 2 is used as an index into this array; if the item is not editable,
  160.                                         then the property # times 2 plus 1 is used
  161.  
  162.  
  163.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  164.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  165.                                         is used in a selection dialog invoked by an 'Add...' button
  166.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  167.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  168.                                         is the tag; the rest is the attribute value contents
  169.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  170.                                         from a code resource, or via a default value in a resource)
  171.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  172.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  173.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like 'add' or 'drop'; if
  174.                                         there's any doubt, use 'OK')
  175.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  176.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  177.                                         can be dragged into this aspect, and the second is the attribute type to store
  178.                                         the reference in
  179.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  180.                                         category of records which can be dragged in, and the second is the type of
  181.                                         attribute to place the alias in
  182.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  183.                                         dragged from (or '' for any), the second is the attribute type which can be dragged
  184.                                         in, and the third is the attribute type to store the new attribute in
  185.  
  186.  
  187.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  188.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  189.                                         everything can be dragged out)
  190.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  191.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  192.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  193.                                             page-selector (main aspect only)
  194.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  195. */
  196.  
  197.  
  198. #define kDETAspectCode                     4
  199. #define kDETAspectMainBitmap             5
  200. #define kDETAspectName                     6
  201. #define kDETAspectCategory                 7
  202. #define kDETAspectExternalCategory         8
  203. #define kDETAspectKind                     9
  204. #define kDETAspectGender                10
  205. #define kDETAspectWhatIs                11
  206. #define kDETAspectAliasKind                12
  207. #define kDETAspectAliasGender            13
  208. #define kDETAspectAliasWhatIs            14
  209. #define kDETAspectBalloons                15
  210. #define kDETAspectNewMenuName            16
  211. #define kDETAspectNewEntryName            17
  212. #define kDETAspectNewValue                18
  213. #define kDETAspectSublistOpenOnNew        19
  214. #define kDETAspectLookup                20
  215. #define kDETAspectDragInString            21
  216. #define kDETAspectDragInVerb            22
  217. #define kDETAspectDragInSummary            23
  218. #define kDETAspectRecordDragIn            24
  219. #define kDETAspectRecordCatDragIn        25
  220. #define kDETAspectAttrDragIn            26
  221. #define kDETAspectAttrDragOut            27
  222. #define kDETAspectViewMenu                28
  223. #define kDETAspectReverseSort            29
  224. #define kDETAspectInfoPageCustomWindow    30
  225.  
  226.  
  227.  
  228. /* Properties: */
  229.  
  230. #define kDETNoProperty                -1
  231.  
  232. /* Each aspect has 250 attribute properties in this range: */
  233. #define kDETFirstLocalProperty        0
  234. #define kDETLastLocalProperty         (kDETFirstLocalProperty+249)
  235.  
  236. /* Developers should use property numbers starting at this point: */
  237. #define kDETFirstDevProperty        40
  238.  
  239. /* The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  240.    given by kDETFirstConstantProperty+n): */
  241. #define kDETFirstConstantProperty    250
  242. #define kDETLastConstantProperty    (kDETFirstConstantProperty+249)
  243.  
  244. /* To convert a number into a constant property, add this: */
  245. #define kDETConstantProperty        kDETFirstConstantProperty
  246.  
  247. #define kDETZeroProperty            (kDETConstantProperty+0)
  248. #define kDETOneProperty                (kDETConstantProperty+1)
  249. #define kDETFalseProperty            (kDETConstantProperty+0)
  250. #define kDETTrueProperty            (kDETConstantProperty+1)
  251.  
  252. /* The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: */
  253. #define kDETPrName                     3050
  254. #define kDETPrKind                     3051
  255.  
  256. /* Access mask properties: */
  257. #define kDETDNodeAccessMask            25825    /* The DNode access mask */
  258. #define kDETRecordAccessMask        25826    /* The record access mask */
  259. #define kDETAttributeAccessMask        25827    /* The attribute access mask */
  260. #define kDETPrimaryMaskByBit        25828    /* A set of sixteen properties to access all bits of the primary mask */
  261.  
  262.  
  263.  
  264. /* See AOCE documentation for details definitions of each of these bits: */
  265. #define kDETPrimarySeeMask            kDETPrimaryMaskByBit
  266. #define kDETPrimaryAddMask            (kDETPrimaryMaskByBit+1)
  267. #define kDETPrimaryDeleteMask        (kDETPrimaryMaskByBit+2)
  268. #define kDETPrimaryChangeMask        (kDETPrimaryMaskByBit+3)
  269. #define kDETPrimaryRenameMask        (kDETPrimaryMaskByBit+4)
  270. #define kDETPrimaryChangePrivsMask    (kDETPrimaryMaskByBit+5)
  271. #define kDETPrimaryTopMaskBit        (kDETPrimaryMaskByBit+15)
  272.  
  273. /* The following property is zero until we've completed the first catalog lookup; from then on it's 1 */
  274. #define kDETPastFirstLookup            26550
  275.  
  276. /* The following property is the page number; issuing a property command with this property will flip info-pages */
  277. #define kDETInfoPageNumber            27050
  278.  
  279. /* The value of the following properties contains the template number of the targeted aspect's template, and the
  280.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  281.    target selectors. */
  282. #define kDETAspectTemplateNumber    26551
  283. #define kDETInfoPageTemplateNumber    26552
  284.  
  285. /* Properties for property commands to deal with sublist items: */
  286. #define kDETOpenSelectedItems        26553    /* Open selected sublist items */
  287. #define kDETAddNewItem                26554    /* Add new sublist item */
  288. #define kDETRemoveSelectedItems        26555    /* Remove selected sublist items */
  289.  
  290. /* Property types are used to specify types of properties and conversions between types (zero and negative numbers
  291.    are reserved for Apple; developer code resources can use positive numbers): */
  292. #define kDETPrTypeNumber            -1    /* A number */
  293. #define kDETPrTypeString            -2    /* A string */
  294. #define kDETPrTypeBinary            -3    /* A binary block */
  295.  
  296. /* Rez-compatible tag definitions (These are the same as in OCE.h, but they're enums there and can't be rezed•••) */
  297. #ifdef REZ
  298. #define typeRString            'rstr'
  299. #define typePackedDSSpec    'dspc'
  300. #define typeBinary            'bnry'
  301. #endif
  302.  
  303.  
  304.  
  305. /* ************************************ Info-pages */
  306.  
  307. /* Info-pages include the following as well:
  308.  
  309.      Type    Offset                        Description
  310.      ----    ------                        -----------
  311.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  312.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  313.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  314.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ('Catalogs' if not present)
  315.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  316.  
  317. */
  318.  
  319. #define kDETInfoPageName            4
  320. #define kDETInfoPageMainViewAspect    5
  321. #define kDETInfoPageMenuName        6
  322. #define kDETInfoPageMenuEntries        7
  323.  
  324.  
  325.  
  326.  
  327. /* ************************************ Views 
  328.  
  329.    Flags: */
  330.  
  331. #define kDETNoFlags                        0
  332. #define kDETEnabled                        (1 << 0)    /* Main view (non-sublist) field enabled */
  333.  
  334. /* The following flags make sense for items in a sublist only */
  335. #define kDETHilightIfSelected            (1 << 0)    /* Hilight view when entry is selected */
  336.  
  337. /* The following flags make sense for text views only */
  338. #define kDETNumericOnly                    (1 << 3)    /* Only allow the user to enter digits */
  339. #define kDETMultiLine                    (1 << 4)    /* Allow multiple lines in view */
  340. #define kDETDynamicSize                    (1 << 9)    /* Don't draw box around text until user clicks in it, then auto-size it */
  341. #define kDETAllowNoColons                (1 << 10)    /* Don't allow the user to enter colons (convert ':'s to '-'s) */
  342.  
  343. /* The following flags are used for pop-up menus only */
  344. #define kDETPopupDynamicSize            (1 << 8)    /* Automatically resize pop-up based on contents */
  345.  
  346. /* The following flags are used for EditPicture views only */
  347. #define kDETScaleToView                    (1 << 8)    /* Scale picture to view bounds rather than cropping */
  348.  
  349. /*    Sizes for icons */
  350. #define kDETLargeIcon        0
  351. #define kDETSmallIcon        1
  352. #define kDETMiniIcon        2
  353.  
  354. /* Stolen from TextEdit.h */
  355. #define kDETLeft          0
  356. #define kDETCenter          1
  357. #define kDETRight         -1
  358. #define kDETForceLeft    -2
  359.  
  360.  
  361.  
  362. /* Flags for use within Box view type attributes - these are distinct from the flags above */
  363.  
  364. #define    kDETUnused                    0
  365. #define kDETBoxTakesContentClicks    (1 << 0)
  366. #define kDETBoxIsRounded            (1 << 1)
  367. #define kDETBoxIsGrayed                (1 << 2)
  368. #define kDETBoxIsInvisible            (1 << 3)
  369.  
  370. /* The common font info */
  371.  
  372. #define kDETApplicationFont                 1
  373. #define kDETApplicationFontSize          9
  374. #define kDETAppFontLineHeight            12
  375.  
  376. #define kDETSystemFont                     0
  377. #define kDETSystemFontSize                12
  378. #define kDETSystemFontLineHeight        16
  379.  
  380. #define kDETDefaultFont                     1
  381. #define kDETDefaultFontSize                 9
  382. #define kDETDefaultFontLineHeight        12
  383.  
  384. /*    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): */
  385. #define kDETNormal                        0
  386. #define kDETBold                        1
  387. #define kDETItalic                        2
  388. #define kDETUnderline                    4
  389. #define kDETOutline                        8
  390. #define kDETShadow                     0x10
  391. #define kDETCondense                 0x20
  392. #define kDETExtend                     0x40
  393.  
  394. #define kDETIconStyle                   -3    /* Normal text style for regular sublist entries, italic text style for aliases */
  395.  
  396. /* View menu: */
  397.  
  398. #define    kDETChangeViewCommand        'view'    /* Change the view; used especially in StaticCommandTextFromView sublist headers */
  399.  
  400.  
  401. /* Info-page window sizes: */
  402.  
  403. /* Default record info-pages: */
  404. #define kDETRecordInfoWindHeight        228
  405. #define kDETRecordInfoWindWidth            400
  406.  
  407. /* Default attribute info-pages: */
  408. #define kDETAttributeInfoWindHeight        250
  409. #define kDETAttributeInfoWindWidth        230
  410.  
  411. /* Page identifying icon (for default info-page layout): */
  412. #define kDETSubpageIconTop        8
  413. #define kDETSubpageIconLeft        8
  414. #define kDETSubpageIconBottom    (kDETSubpageIconTop+32)
  415. #define kDETSubpageIconRight    (kDETSubpageIconLeft+32)
  416. #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight}
  417.  
  418. /* The following rectangle can be used in a 'deti' with no sublist: */
  419. #define kDETNoSublistRect        {0, 0, 0, 0}
  420.  
  421.  
  422.  
  423.  
  424. /* ************************************ Killers 
  425.  
  426.    Killers include the following as well:
  427.  
  428.      Type    Offset                        Description
  429.      ----    ------                        -----------
  430.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  431.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  432.  
  433. */
  434.  
  435. #define kDETKillerName 1
  436.  
  437.  
  438. /* ************************************ Forwarders 
  439.  
  440.    Forwarders include the following as well:
  441.  
  442.      Type    Offset                        Description
  443.      ----    ------                        -----------
  444.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  445.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  446.  
  447. */
  448.  
  449. #define kDETForwarderTemplateNames    4
  450.  
  451.  
  452.  
  453. /*********************************************************************************** 
  454.  ********************************* Categories: ************************************* 
  455.  *********************************************************************************** 
  456.  
  457.    Internal category names: */
  458.  
  459. #define kDETCategoryAllItems        "aoce All Items"        /* Everything in or out of a category */
  460. #define kDETCategoryAddressItems    "aoce Address Items"    /* Anything that can be used to address something */
  461. #define kDETCategoryMisc            "aoce Miscellaneous"    /* Things that don't deserve their own category */
  462.  
  463.  
  464.  
  465. /***********************************************************************************/
  466. /********************************* Code Resources: *********************************/
  467. /***********************************************************************************/
  468. #ifndef REZ
  469. /* Target specification: */
  470.  
  471. enum {
  472.     kDETSelf                    = 0,                            /* The "current" item */
  473.     kDETSelfOtherAspect            = 1,                            /* Another aspect of the current item */
  474.     kDETParent                    = 2,                            /* The parent (i.e., the aspect we're in the sublist of, if any) of the current item */
  475.     kDETSublistItem                = 3,                            /* The itemNumberth item in the sublist */
  476.     kDETSelectedSublistItem        = 4,                            /* The itemNumberth selected item in the sublist */
  477.     kDETDSSpec                    = 5,                            /* The item specified by the packed DSSpec */
  478.     kDETAspectTemplate            = 6,                            /* A specific aspect template (number itemNumber) */
  479.     kDETInfoPageTemplate        = 7,                            /* A specific info-page template (number itemNumber) * Force type to be short */
  480.     kDETHighSelector            = 0xF000
  481. };
  482.  
  483. typedef long                             DETTargetSelector;
  484. struct DETTargetSpecification {
  485.     DETTargetSelector                 selector;                    /* Target selection method (see above) */
  486.     RStringPtr                         aspectName;                    /* The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,*/
  487.                                                                 /*   kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none; */
  488.                                                                 /*  always filled in for calls if there is an aspect, even if it's the main aspect */
  489.     long                             itemNumber;                    /* Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);*/
  490.                                                                 /*   1-based indexing */
  491.     PackedDSSpecPtr                 dsSpec;                        /* DSSpec (kDETDSSpec only) */
  492. };
  493. typedef struct DETTargetSpecification DETTargetSpecification;
  494.  
  495. /* Code resource calls and call-backs both return an OSType:
  496.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  497.         noErr                    = function completed successfully
  498.         any error                = function failed, and here's why
  499. */
  500. #define kDETDidNotHandle 1
  501. /* Call-back functions:
  502.  
  503.         reqFunction                            Action
  504.         -----------                            ------
  505.         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  506.  
  507.         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  508.  
  509.         kDETcmdChangeCallFors                Change call-fors mask
  510.  
  511.         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  512.         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  513.  
  514.         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  515.  
  516.         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  517.  
  518.         kDETcmdUnloadTemplates                Flush templates
  519.  
  520.         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  521.  
  522.         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  523.  
  524.         kDETcmdSublistCount                    Return the count of the sublist items
  525.         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  526.  
  527.         kDETcmdRequestSync                    Request a sync-up of the aspect with the catalog
  528.  
  529.         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  530.  
  531.         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template
  532.  
  533.         kDETcmdGetOpenEdit                    Return the property of the view being edited (or kDETNoProperty if none)
  534.         kDETcmdCloseEdit                    Close the current edit
  535.  
  536.         kDETcmdGetPropertyType                Get a property type
  537.  
  538.         kDETcmdGetPropertyNumber            Get a property, number format
  539.         kDETcmdGetPropertyRString            Get a property, RString format
  540.         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  541.         kDETcmdGetPropertyBinary            Get a property, binary format
  542.  
  543.         kDETcmdGetPropertyChanged            Get a property changed flag
  544.         kDETcmdGetPropertyEditable            Get a property editable flag
  545.  
  546.         kDETcmdSetPropertyType                Set a property type
  547.  
  548.         kDETcmdSetPropertyNumber            Set a property, number format
  549.         kDETcmdSetPropertyRString            Set a property, RString format
  550.         kDETcmdSetPropertyBinary            Set a property, binary data & size
  551.  
  552.         kDETcmdSetPropertyChanged            Set a property changed flag
  553.         kDETcmdSetPropertyEditable            Set a property editable flag
  554.  
  555.         kDETcmdDirtyProperty                Dirty a property (notify other code resources of change)
  556.  
  557.         kDETcmdDoPropertyCommand            Issue a property command
  558.  
  559.         kDETcmdAddMenu                        Add to the end of a dynamic menu
  560.         kDETcmdRemoveMenu                    Remove a dynamic menu item
  561.         kDETcmdMenuItemRString                Get a dynamic menu item RString
  562.  
  563.         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  564.  
  565.         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  566.         kDETcmdGetCustomViewBounds            Get custom view current bounds
  567.  
  568.         kDETcmdGetResource                    Get a resource from a template
  569. */
  570.  
  571.  
  572. enum {
  573.     kDETcmdSimpleCallback        = 0,
  574.     kDETcmdBeep                    = 1,
  575.     kDETcmdBusy                    = 2,
  576.     kDETcmdChangeCallFors        = 3,
  577.     kDETcmdGetCommandSelectionCount = 4,
  578.     kDETcmdGetCommandItemN        = 5,
  579.     kDETcmdOpenDSSpec            = 6,
  580.     kDETcmdAboutToTalk            = 7,
  581.     kDETcmdUnloadTemplates        = 8,
  582.     kDETcmdTemplateCounts        = 9,
  583.     kDETcmdTargetedCallback        = 1000,
  584.     kDETcmdGetDSSpec            = 1001,
  585.     kDETcmdSublistCount            = 1002,
  586.     kDETcmdSelectedSublistCount    = 1003,
  587.     kDETcmdRequestSync            = 1004,
  588.     kDETcmdBreakAttribute        = 1005,
  589.     kDETcmdGetTemplateFSSpec    = 1006,
  590.     kDETcmdGetOpenEdit            = 1007,
  591.     kDETcmdCloseEdit            = 1008,
  592.     kDETcmdPropertyCallback        = 2000,
  593.     kDETcmdGetPropertyType        = 2001,
  594.     kDETcmdGetPropertyNumber    = 2002,
  595.     kDETcmdGetPropertyRString    = 2003,
  596.     kDETcmdGetPropertyBinarySize = 2004,
  597.     kDETcmdGetPropertyBinary    = 2005,
  598.     kDETcmdGetPropertyChanged    = 2006,
  599.     kDETcmdGetPropertyEditable    = 2007,
  600.     kDETcmdSetPropertyType        = 2008,
  601.     kDETcmdSetPropertyNumber    = 2009,
  602.     kDETcmdSetPropertyRString    = 2010,
  603.     kDETcmdSetPropertyBinary    = 2011,
  604.     kDETcmdSetPropertyChanged    = 2012,
  605.     kDETcmdSetPropertyEditable    = 2013,
  606.     kDETcmdDirtyProperty        = 2014,
  607.     kDETcmdDoPropertyCommand    = 2015,
  608.     kDETcmdAddMenu                = 2016,
  609.     kDETcmdRemoveMenu            = 2017,
  610.     kDETcmdMenuItemRString        = 2018,
  611.     kDETcmdSaveProperty            = 2019,
  612.     kDETcmdGetCustomViewUserReference = 2020,
  613.     kDETcmdGetCustomViewBounds    = 2021,
  614.     kDETcmdGetResource            = 2022,                            /* Force type to be long */
  615.     kDETcmdHighCallback            = (long)0xF0000000
  616. };
  617.  
  618. typedef unsigned long                     DETCallBackFunctions;
  619. /* Call functions:
  620.  
  621.         reqFunction                        Action
  622.         -----------                        ------
  623.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  624.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  625.  
  626.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  627.                                         the value that's about to be created; sent to the template that will be used for
  628.                                         the main aspect of the new entry
  629.  
  630.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  631.  
  632.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  633.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  634.  
  635.         kDETcmdIdle                        Called periodically during idle times
  636.  
  637.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  638.  
  639.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  640.  
  641.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  642.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  643.  
  644.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  645.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  646.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  647.                                         main aspect of the attribute that's about to be deleted
  648.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  649.  
  650.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  651.  
  652.         kDETcmdDynamicResource            Return a dynamically created resource
  653.  
  654.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  655.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  656.  
  657.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  658.  
  659.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  660.  
  661.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  662.  
  663.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  664.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  665.  
  666.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  667.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  668.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  669.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  670.  
  671.         kDETcmdCustomViewDraw            Custom view draw
  672.         kDETcmdCustomViewMouseDown        Custom view mouse down
  673.  
  674.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  675.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  676.  
  677.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  678.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  679. */
  680.  
  681.  
  682. enum {
  683.     kDETcmdSimpleCall            = 0,
  684.     kDETcmdInit                    = 1,
  685.     kDETcmdExit                    = 2,
  686.     kDETcmdAttributeCreation    = 3,
  687.     kDETcmdDynamicForwarders    = 4,
  688.     kDETcmdTargetedCall            = 1000,
  689.     kDETcmdInstanceInit            = 1001,
  690.     kDETcmdInstanceExit            = 1002,
  691.     kDETcmdIdle                    = 1003,
  692.     kDETcmdViewListChanged        = 1004,
  693.     kDETcmdValidateSave            = 1005,
  694.     kDETcmdDropQuery            = 1006,
  695.     kDETcmdDropMeQuery            = 1007,
  696.     kDETcmdAttributeNew            = 1008,
  697.     kDETcmdAttributeChange        = 1009,
  698.     kDETcmdAttributeDelete        = 1010,
  699.     kDETcmdItemNew                = 1011,
  700.     kDETcmdOpenSelf                = 1012,
  701.     kDETcmdDynamicResource        = 1013,
  702.     kDETcmdShouldSync            = 1014,
  703.     kDETcmdDoSync                = 1015,
  704.     kDETcmdPropertyCall            = 2000,
  705.     kDETcmdPropertyCommand        = 2001,
  706.     kDETcmdMaximumTextLength    = 2002,
  707.     kDETcmdPropertyDirtied        = 2003,
  708.     kDETcmdPatternIn            = 2004,
  709.     kDETcmdPatternOut            = 2005,
  710.     kDETcmdConvertToNumber        = 2006,
  711.     kDETcmdConvertToRString        = 2007,
  712.     kDETcmdConvertFromNumber    = 2008,
  713.     kDETcmdConvertFromRString    = 2009,
  714.     kDETcmdCustomViewDraw        = 2010,
  715.     kDETcmdCustomViewMouseDown    = 2011,
  716.     kDETcmdKeyPress                = 2012,
  717.     kDETcmdPaste                = 2013,
  718.     kDETcmdCustomMenuSelected    = 2014,
  719.     kDETcmdCustomMenuEnabled    = 2015,
  720.     kDETcmdHighCall                = (long)0xF0000000                /* Force the type to be long */
  721. };
  722.  
  723. typedef unsigned long                     DETCallFunctions;
  724. /* Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): */
  725.  
  726. enum {
  727.     kDETDoNothing                = FOUR_CHAR_CODE('xxx0'),
  728.     kDETMove                    = FOUR_CHAR_CODE('move'),
  729.     kDETDrag                    = FOUR_CHAR_CODE('drag'),
  730.     kDETAlias                    = FOUR_CHAR_CODE('alis')
  731. };
  732.  
  733.  
  734. struct DETProtoCallBackBlock {
  735.     DETCallBackFunctions             reqFunction;                /* Requested function */
  736.     DETTargetSpecification             target;                        /* The target for the request */
  737.     short                             property;                    /* The property to apply the request to */
  738. };
  739. typedef struct DETProtoCallBackBlock DETProtoCallBackBlock;
  740.  
  741. struct DETBeepBlock {
  742.     DETCallBackFunctions             reqFunction;                /* Requested function */
  743. };
  744. typedef struct DETBeepBlock DETBeepBlock;
  745.  
  746. struct DETBusyBlock {
  747.     DETCallBackFunctions             reqFunction;                /* Requested function */
  748. };
  749. typedef struct DETBusyBlock DETBusyBlock;
  750.  
  751. struct DETChangeCallForsBlock {
  752.     DETCallBackFunctions             reqFunction;                /* Requested function */
  753.     DETTargetSpecification             target;                        /* The target for the request */
  754.     long                             newCallFors;                /*  -> New call-for mask */
  755. };
  756. typedef struct DETChangeCallForsBlock DETChangeCallForsBlock;
  757.  
  758. struct DETGetCommandSelectionCountBlock {
  759.     DETCallBackFunctions             reqFunction;                /* Requested function */
  760.     long                             count;                        /* <-  The number of items in the command selection list */
  761. };
  762. typedef struct DETGetCommandSelectionCountBlock DETGetCommandSelectionCountBlock;
  763.  
  764.  
  765. enum {
  766.     kDETHFSType                    = 0,                            /* HFS item type */
  767.     kDETDSType                    = 1,                            /* Catalog Service item type */
  768.     kDETMailType                = 2,                            /* Mail (letter) item type */
  769.     kDETMoverType                = 3,                            /* Sounds, fonts, etc., from inside a suitcase or system file */
  770.     kDETLastItemType            = (long)0xF0000000                /* Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) */
  771. };
  772.  
  773. typedef unsigned long                     DETItemType;
  774. /* FSSpec plus possibly interesting additional info */
  775. struct DETFSInfo {
  776.     OSType                             fileType;                    /* File type */
  777.     OSType                             fileCreator;                /* File creator */
  778.     unsigned short                     fdFlags;                    /* Finder flags */
  779.     FSSpec                             fsSpec;                        /* FSSpec */
  780. };
  781. typedef struct DETFSInfo DETFSInfo;
  782.  
  783. struct DSRec {
  784.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  785.     short                             refNum;                        /* <-  Refnum for returned address */
  786.     AuthIdentity                     identity;                    /* <-  Identity for returned address */
  787. };
  788. typedef struct DSRec DSRec;
  789.  
  790. union ItemRec {
  791.     DETFSInfo **                    fsInfo;                        /* <-  FSSpec & info for item (caller must DisposHandle() when done) */
  792.     DSRec                             ds;
  793.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  794.     LetterSpec **                    ltrSpec;                    /* <-  Letter spec for item (caller must DisposHandle() when done) */
  795. };
  796. typedef union ItemRec ItemRec;
  797.  
  798. struct DETGetCommandItemNBlock {
  799.     DETCallBackFunctions             reqFunction;                /* Requested function */
  800.     long                             itemNumber;                    /*  -> Item number to retrieve (1-based) */
  801.     DETItemType                     itemType;                    /*  -> Type of item to be returned (if we can interpret it as such) */
  802.     ItemRec                         item;
  803. };
  804. typedef struct DETGetCommandItemNBlock DETGetCommandItemNBlock;
  805.  
  806. struct DETGetDSSpecBlock {
  807.     DETCallBackFunctions             reqFunction;                /* Requested function */
  808.     DETTargetSpecification             target;                        /* The target for the request */
  809.     PackedDSSpecPtr *                dsSpec;                        /* <-  Handle with result (caller must DisposHandle() when done) */
  810.     short                             refNum;                        /* <-  Refnum for address if PD */
  811.     AuthIdentity                     identity;                    /* <-  Identity for address */
  812.     Boolean                         isAlias;                    /* <-  True if this entry is an alias */
  813.     Boolean                         isRecordRef;                /* <-  True if this entry is a record reference (reserved) */
  814. };
  815. typedef struct DETGetDSSpecBlock DETGetDSSpecBlock;
  816.  
  817. struct DETGetTemplateFSSpecBlock {
  818.     DETCallBackFunctions             reqFunction;                /* Requested function */
  819.     DETTargetSpecification             target;                        /* The target for the request */
  820.     FSSpec                             fsSpec;                        /* <-  FSSpec of template file */
  821.     short                             baseID;                        /* <-  Base ID of this template */
  822.     long                             aspectTemplateNumber;        /* <-  The template number for this aspect template */
  823. };
  824. typedef struct DETGetTemplateFSSpecBlock DETGetTemplateFSSpecBlock;
  825.  
  826. struct DETGetOpenEditBlock {
  827.     DETCallBackFunctions             reqFunction;                /* Requested function */
  828.     DETTargetSpecification             target;                        /* The target for the request */
  829.     short                             viewProperty;                /* <-  The property of the view being edited (or kNoProperty if none) */
  830. };
  831. typedef struct DETGetOpenEditBlock DETGetOpenEditBlock;
  832.  
  833. struct DETCloseEditBlock {
  834.     DETCallBackFunctions             reqFunction;                /* Requested function */
  835.     DETTargetSpecification             target;                        /* The target for the request */
  836. };
  837. typedef struct DETCloseEditBlock DETCloseEditBlock;
  838.  
  839. struct DETGetPropertyTypeBlock {
  840.     DETCallBackFunctions             reqFunction;                /* Requested function */
  841.     DETTargetSpecification             target;                        /* The target for the request */
  842.     short                             property;                    /* The property to apply the request to */
  843.     short                             propertyType;                /* <-  The type of the property */
  844. };
  845. typedef struct DETGetPropertyTypeBlock DETGetPropertyTypeBlock;
  846.  
  847. struct DETGetPropertyNumberBlock {
  848.     DETCallBackFunctions             reqFunction;                /* Requested function */
  849.     DETTargetSpecification             target;                        /* The target for the request */
  850.     short                             property;                    /* The property to apply the request to */
  851.     unsigned long                     propertyValue;                /* <-  The value of the property */
  852. };
  853. typedef struct DETGetPropertyNumberBlock DETGetPropertyNumberBlock;
  854.  
  855. struct DETGetPropertyRStringBlock {
  856.     DETCallBackFunctions             reqFunction;                /* Requested function */
  857.     DETTargetSpecification             target;                        /* The target for the request */
  858.     short                             property;                    /* The property to apply the request to */
  859.     RStringHandle                     propertyValue;                /* <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) */
  860. };
  861. typedef struct DETGetPropertyRStringBlock DETGetPropertyRStringBlock;
  862.  
  863. struct DETGetPropertyBinarySizeBlock {
  864.     DETCallBackFunctions             reqFunction;                /* Requested function */
  865.     DETTargetSpecification             target;                        /* The target for the request */
  866.     short                             property;                    /* The property to apply the request to */
  867.     long                             propertyBinarySize;            /* <-  The size of the property as a binary block */
  868. };
  869. typedef struct DETGetPropertyBinarySizeBlock DETGetPropertyBinarySizeBlock;
  870.  
  871. struct DETGetPropertyBinaryBlock {
  872.     DETCallBackFunctions             reqFunction;                /* Requested function */
  873.     DETTargetSpecification             target;                        /* The target for the request */
  874.     short                             property;                    /* The property to apply the request to */
  875.     Handle                             propertyValue;                /* <-  Handle with the value of the property (caller must DisposHandle() when done) */
  876. };
  877. typedef struct DETGetPropertyBinaryBlock DETGetPropertyBinaryBlock;
  878.  
  879. struct DETGetPropertyChangedBlock {
  880.     DETCallBackFunctions             reqFunction;                /* Requested function */
  881.     DETTargetSpecification             target;                        /* The target for the request */
  882.     short                             property;                    /* The property to apply the request to */
  883.     Boolean                         propertyChanged;            /* <-  True if the property is marked as changed */
  884.     Boolean                         filler1;
  885. };
  886. typedef struct DETGetPropertyChangedBlock DETGetPropertyChangedBlock;
  887.  
  888. struct DETGetPropertyEditableBlock {
  889.     DETCallBackFunctions             reqFunction;                /* Requested function */
  890.     DETTargetSpecification             target;                        /* The target for the request */
  891.     short                             property;                    /* The property to apply the request to */
  892.     Boolean                         propertyEditable;            /* <-  True if the property can be edited by the user (if false, view will appear disabled) */
  893.     Boolean                         filler1;
  894. };
  895. typedef struct DETGetPropertyEditableBlock DETGetPropertyEditableBlock;
  896.  
  897. struct DETSetPropertyTypeBlock {
  898.     DETCallBackFunctions             reqFunction;                /* Requested function */
  899.     DETTargetSpecification             target;                        /* The target for the request */
  900.     short                             property;                    /* The property to apply the request to */
  901.     short                             newType;                    /*  -> New type for property (just sets type, does not convert contents) */
  902. };
  903. typedef struct DETSetPropertyTypeBlock DETSetPropertyTypeBlock;
  904.  
  905. struct DETSetPropertyNumberBlock {
  906.     DETCallBackFunctions             reqFunction;                /* Requested function */
  907.     DETTargetSpecification             target;                        /* The target for the request */
  908.     short                             property;                    /* The property to apply the request to */
  909.     unsigned long                     newValue;                    /*  -> New value to set property to (and set type to number) */
  910. };
  911. typedef struct DETSetPropertyNumberBlock DETSetPropertyNumberBlock;
  912.  
  913. struct DETSetPropertyRStringBlock {
  914.     DETCallBackFunctions             reqFunction;                /* Requested function */
  915.     DETTargetSpecification             target;                        /* The target for the request */
  916.     short                             property;                    /* The property to apply the request to */
  917.     RStringPtr                         newValue;                    /*  -> New value to set property to (and set type to RString) */
  918. };
  919. typedef struct DETSetPropertyRStringBlock DETSetPropertyRStringBlock;
  920.  
  921. struct DETSetPropertyBinaryBlock {
  922.     DETCallBackFunctions             reqFunction;                /* Requested function */
  923.     DETTargetSpecification             target;                        /* The target for the request */
  924.     short                             property;                    /* The property to apply the request to */
  925.     void *                            newValue;                    /*  -> New value to set property to (and set type to binary) */
  926.     long                             newValueSize;                /*  -> Size of new value */
  927. };
  928. typedef struct DETSetPropertyBinaryBlock DETSetPropertyBinaryBlock;
  929.  
  930. struct DETSetPropertyChangedBlock {
  931.     DETCallBackFunctions             reqFunction;                /* Requested function */
  932.     DETTargetSpecification             target;                        /* The target for the request */
  933.     short                             property;                    /* The property to apply the request to */
  934.     Boolean                         propertyChanged;            /*  -> Value to set changed flag on property to */
  935.     Boolean                         filler1;
  936. };
  937. typedef struct DETSetPropertyChangedBlock DETSetPropertyChangedBlock;
  938.  
  939. struct DETSetPropertyEditableBlock {
  940.     DETCallBackFunctions             reqFunction;                /* Requested function */
  941.     DETTargetSpecification             target;                        /* The target for the request */
  942.     short                             property;                    /* The property to apply the request to */
  943.     Boolean                         propertyEditable;            /*  -> Value to set editable flag on property to */
  944.     Boolean                         filler1;
  945. };
  946. typedef struct DETSetPropertyEditableBlock DETSetPropertyEditableBlock;
  947.  
  948. struct DETDirtyPropertyBlock {
  949.     DETCallBackFunctions             reqFunction;                /* Requested function */
  950.     DETTargetSpecification             target;                        /* The target for the request */
  951.     short                             property;                    /* The property to apply the request to */
  952. };
  953. typedef struct DETDirtyPropertyBlock DETDirtyPropertyBlock;
  954.  
  955. struct DETDoPropertyCommandBlock {
  956.     DETCallBackFunctions             reqFunction;                /* Requested function */
  957.     DETTargetSpecification             target;                        /* The target for the request */
  958.     short                             property;                    /* The property to apply the request to */
  959.     long                             parameter;                    /* ->  Parameter of command */
  960. };
  961. typedef struct DETDoPropertyCommandBlock DETDoPropertyCommandBlock;
  962.  
  963. struct DETSublistCountBlock {
  964.     DETCallBackFunctions             reqFunction;                /* Requested function */
  965.     DETTargetSpecification             target;                        /* The target for the request */
  966.     long                             count;                        /* <-  The number of items in the current item's sublist */
  967. };
  968. typedef struct DETSublistCountBlock DETSublistCountBlock;
  969.  
  970. struct DETSelectedSublistCountBlock {
  971.     DETCallBackFunctions             reqFunction;                /* Requested function */
  972.     DETTargetSpecification             target;                        /* The target for the request */
  973.     long                             count;                        /* <-  The number of selected items in the current item's sublist */
  974. };
  975. typedef struct DETSelectedSublistCountBlock DETSelectedSublistCountBlock;
  976.  
  977. struct DETRequestSyncBlock {
  978.     DETCallBackFunctions             reqFunction;                /* Requested function */
  979.     DETTargetSpecification             target;                        /* The target for the request */
  980. };
  981. typedef struct DETRequestSyncBlock DETRequestSyncBlock;
  982.  
  983. struct DETAddMenuBlock {
  984.     DETCallBackFunctions             reqFunction;                /* Requested function */
  985.     DETTargetSpecification             target;                        /* The target for the request */
  986.     short                             property;                    /* The property to apply the request to */
  987.     RString *                        name;                        /*  -> Name of new menu item */
  988.     long                             parameter;                    /*  -> Parameter to return when this item is selected */
  989.     long                             addAfter;                    /*  -> Parameter of entry to add after, or -1 for add at end */
  990. };
  991. typedef struct DETAddMenuBlock DETAddMenuBlock;
  992.  
  993. struct DETRemoveMenuBlock {
  994.     DETCallBackFunctions             reqFunction;                /* Requested function */
  995.     DETTargetSpecification             target;                        /* The target for the request */
  996.     short                             property;                    /* The property to apply the request to */
  997.     long                             itemToRemove;                /*  -> Parameter of menu item to remove */
  998. };
  999. typedef struct DETRemoveMenuBlock DETRemoveMenuBlock;
  1000.  
  1001. struct DETMenuItemRStringBlock {
  1002.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1003.     DETTargetSpecification             target;                        /* The target for the request */
  1004.     short                             property;                    /* The property to apply the request to */
  1005.     long                             itemParameter;                /*  -> Parameter of menu item to return string for */
  1006.     RStringHandle                     rString;                    /* <-  Handle with the RString (caller must DisposHandle() when done) */
  1007. };
  1008. typedef struct DETMenuItemRStringBlock DETMenuItemRStringBlock;
  1009.  
  1010. struct DETOpenDSSpecBlock {
  1011.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1012.     PackedDSSpecPtr                 dsSpec;                        /*  -> DSSpec of object to be opened */
  1013. };
  1014. typedef struct DETOpenDSSpecBlock DETOpenDSSpecBlock;
  1015.  
  1016. struct DETAboutToTalkBlock {
  1017.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1018. };
  1019. typedef struct DETAboutToTalkBlock DETAboutToTalkBlock;
  1020.  
  1021. struct DETBreakAttributeBlock {
  1022.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1023.     DETTargetSpecification             target;                        /* The target for the request */
  1024.     AttributePtr                     breakAttribute;                /*  -> Attribute to parse */
  1025.     Boolean                         isChangeable;                /*  -> True if the value can be changed by the user */
  1026.     Boolean                         filler1;
  1027. };
  1028. typedef struct DETBreakAttributeBlock DETBreakAttributeBlock;
  1029.  
  1030. struct DETSavePropertyBlock {
  1031.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1032.     DETTargetSpecification             target;                        /* The target for the request */
  1033.     short                             property;                    /* The property to apply the request to */
  1034. };
  1035. typedef struct DETSavePropertyBlock DETSavePropertyBlock;
  1036.  
  1037. struct DETGetCustomViewUserReferenceBlock {
  1038.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1039.     DETTargetSpecification             target;                        /* The target for the request */
  1040.     short                             property;                    /* The property to apply the request to */
  1041.     short                             userReference;                /* <-  User reference value, as specified in the .r file */
  1042. };
  1043. typedef struct DETGetCustomViewUserReferenceBlock DETGetCustomViewUserReferenceBlock;
  1044.  
  1045. struct DETGetCustomViewBoundsBlock {
  1046.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1047.     DETTargetSpecification             target;                        /* The target for the request */
  1048.     short                             property;                    /* The property to apply the request to */
  1049.     Rect                             bounds;                        /* <-  Bounds of the view */
  1050. };
  1051. typedef struct DETGetCustomViewBoundsBlock DETGetCustomViewBoundsBlock;
  1052.  
  1053. struct DETGetResourceBlock {
  1054.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1055.     DETTargetSpecification             target;                        /* The target for the request */
  1056.     short                             property;                    /* The property to apply the request to */
  1057.     ResType                         resourceType;                /*  -> Resource type */
  1058.     Handle                             theResource;                /* <-  The resource handle (caller must dispose when done) */
  1059. };
  1060. typedef struct DETGetResourceBlock DETGetResourceBlock;
  1061.  
  1062. struct DETTemplateCounts {
  1063.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1064.     long                             aspectTemplateCount;        /* <-  Number of aspect templates in the system */
  1065.     long                             infoPageTemplateCount;        /* <-  Number of info-page templates in the system */
  1066. };
  1067. typedef struct DETTemplateCounts DETTemplateCounts;
  1068.  
  1069. struct DETUnloadTemplatesBlock {
  1070.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1071. };
  1072. typedef struct DETUnloadTemplatesBlock DETUnloadTemplatesBlock;
  1073.  
  1074.  
  1075. union DETCallBackBlock {
  1076.     DETProtoCallBackBlock             protoCallBack;
  1077.     DETBeepBlock                     beep;
  1078.     DETBusyBlock                     busy;
  1079.     DETChangeCallForsBlock             changeCallFors;
  1080.     DETGetCommandSelectionCountBlock  getCommandSelectionCount;
  1081.     DETGetCommandItemNBlock         getCommandItemN;
  1082.     DETGetDSSpecBlock                 getDSSpec;
  1083.     DETGetTemplateFSSpecBlock         getTemplateFSSpec;
  1084.     DETGetOpenEditBlock             getOpenEdit;
  1085.     DETCloseEditBlock                 closeEdit;
  1086.     DETGetPropertyTypeBlock         getPropertyType;
  1087.     DETGetPropertyNumberBlock         getPropertyNumber;
  1088.     DETGetPropertyRStringBlock         getPropertyRString;
  1089.     DETGetPropertyBinarySizeBlock     getPropertyBinarySize;
  1090.     DETGetPropertyBinaryBlock         getPropertyBinary;
  1091.     DETGetPropertyChangedBlock         getPropertyChanged;
  1092.     DETGetPropertyEditableBlock     getPropertyEditable;
  1093.     DETSetPropertyTypeBlock         setPropertyType;
  1094.     DETSetPropertyNumberBlock         setPropertyNumber;
  1095.     DETSetPropertyRStringBlock         setPropertyRString;
  1096.     DETSetPropertyBinaryBlock         setPropertyBinary;
  1097.     DETSetPropertyChangedBlock         setPropertyChanged;
  1098.     DETSetPropertyEditableBlock     setPropertyEditable;
  1099.     DETDirtyPropertyBlock             dirtyProperty;
  1100.     DETDoPropertyCommandBlock         doPropertyCommand;
  1101.     DETSublistCountBlock             sublistCount;
  1102.     DETSelectedSublistCountBlock     selectedSublistCount;
  1103.     DETRequestSyncBlock             requestSync;
  1104.     DETAddMenuBlock                 addMenu;
  1105.     DETRemoveMenuBlock                 removeMenu;
  1106.     DETMenuItemRStringBlock         menuItemRString;
  1107.     DETOpenDSSpecBlock                 openDSSpec;
  1108.     DETAboutToTalkBlock             aboutToTalk;
  1109.     DETBreakAttributeBlock             breakAttribute;
  1110.     DETSavePropertyBlock             saveProperty;
  1111.     DETGetCustomViewUserReferenceBlock  getCustomViewUserReference;
  1112.     DETGetCustomViewBoundsBlock     getCustomViewBounds;
  1113.     DETGetResourceBlock             getResource;
  1114.     DETTemplateCounts                 templateCounts;
  1115.     DETUnloadTemplatesBlock         unloadTemplates;
  1116. };
  1117. typedef union DETCallBackBlock DETCallBackBlock;
  1118.  
  1119. typedef DETCallBackBlock *                DETCallBackBlockPtr;
  1120. typedef union DETCallBlock                 DETCallBlock;
  1121. typedef DETCallBlock *                    DETCallBlockPtr;
  1122. typedef CALLBACK_API( OSErr , DETCallBackProcPtr )(DETCallBlock *callBlockPtr, DETCallBackBlockPtr callBackBlockPtr);
  1123. typedef STACK_UPP_TYPE(DETCallBackProcPtr)                         DETCallBackUPP;
  1124. typedef DETCallBackUPP                     DETCallBack;
  1125. struct DETProtoCallBlock {
  1126.     DETCallFunctions                 reqFunction;                /* Requested function */
  1127.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1128.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1129.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1130.                                                                 /*    common to all invocations of code resource) */
  1131.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1132.                                                                 /*    code resource) */
  1133.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1134.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1135.     Boolean                         filler1;
  1136.     short                             property;                    /* The property number the call refers to */
  1137. };
  1138. typedef struct DETProtoCallBlock DETProtoCallBlock;
  1139.  
  1140. struct DETInitBlock {
  1141.     DETCallFunctions                 reqFunction;                /* Requested function */
  1142.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1143.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1144.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1145.     long                             newCallFors;                /* <-  New call-for mask */
  1146. };
  1147. typedef struct DETInitBlock DETInitBlock;
  1148.  
  1149. struct DETExitBlock {
  1150.     DETCallFunctions                 reqFunction;                /* Requested function */
  1151.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1152.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1153.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1154. };
  1155. typedef struct DETExitBlock DETExitBlock;
  1156.  
  1157. struct DETInstanceInitBlock {
  1158.     DETCallFunctions                 reqFunction;                /* Requested function */
  1159.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1160.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1161.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1162.                                                                 /*    common to all invocations of code resource) */
  1163.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1164.                                                                 /*    code resource) */
  1165.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1166.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1167.     Boolean                         filler1;
  1168. };
  1169. typedef struct DETInstanceInitBlock DETInstanceInitBlock;
  1170.  
  1171. struct DETInstanceExitBlock {
  1172.     DETCallFunctions                 reqFunction;                /* Requested function */
  1173.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1174.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1175.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1176.                                                                 /*    common to all invocations of code resource) */
  1177.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1178.                                                                 /*    code resource) */
  1179.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1180.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1181.     Boolean                         filler1;
  1182. };
  1183. typedef struct DETInstanceExitBlock DETInstanceExitBlock;
  1184.  
  1185. struct DETInstanceIdleBlock {
  1186.     DETCallFunctions                 reqFunction;                /* Requested function */
  1187.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1188.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1189.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1190.                                                                 /*    common to all invocations of code resource) */
  1191.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1192.                                                                 /*    code resource) */
  1193.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1194.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1195.     Boolean                         filler1;
  1196. };
  1197. typedef struct DETInstanceIdleBlock DETInstanceIdleBlock;
  1198.  
  1199. struct DETPropertyCommandBlock {
  1200.     DETCallFunctions                 reqFunction;                /* Requested function */
  1201.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1202.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1203.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1204.                                                                 /*    common to all invocations of code resource) */
  1205.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1206.                                                                 /*    code resource) */
  1207.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1208.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1209.     Boolean                         filler1;
  1210.     short                             property;                    /* The property number the call refers to */
  1211.     long                             parameter;                    /*  -> Parameter of command */
  1212. };
  1213. typedef struct DETPropertyCommandBlock DETPropertyCommandBlock;
  1214.  
  1215. struct DETMaximumTextLengthBlock {
  1216.     DETCallFunctions                 reqFunction;                /* Requested function */
  1217.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1218.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1219.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1220.                                                                 /*    common to all invocations of code resource) */
  1221.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1222.                                                                 /*    code resource) */
  1223.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1224.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1225.     Boolean                         filler1;
  1226.     short                             property;                    /* The property number the call refers to */
  1227.     long                             maxSize;                    /* <-  Return the maximum number of characters the user can entry when property is edited in an EditText */
  1228. };
  1229. typedef struct DETMaximumTextLengthBlock DETMaximumTextLengthBlock;
  1230.  
  1231. struct DETViewListChangedBlock {
  1232.     DETCallFunctions                 reqFunction;                /* Requested function */
  1233.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1234.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1235.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1236.                                                                 /*    common to all invocations of code resource) */
  1237.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1238.                                                                 /*    code resource) */
  1239.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1240.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1241.     Boolean                         filler1;
  1242. };
  1243. typedef struct DETViewListChangedBlock DETViewListChangedBlock;
  1244.  
  1245. struct DETPropertyDirtiedBlock {
  1246.     DETCallFunctions                 reqFunction;                /* Requested function */
  1247.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1248.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1249.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1250.                                                                 /*    common to all invocations of code resource) */
  1251.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1252.                                                                 /*    code resource) */
  1253.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1254.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1255.     Boolean                         filler1;
  1256.     short                             property;                    /* The property number the call refers to */
  1257. };
  1258. typedef struct DETPropertyDirtiedBlock DETPropertyDirtiedBlock;
  1259.  
  1260. struct DETValidateSaveBlock {
  1261.     DETCallFunctions                 reqFunction;                /* Requested function */
  1262.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1263.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1264.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1265.                                                                 /*    common to all invocations of code resource) */
  1266.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1267.                                                                 /*    code resource) */
  1268.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1269.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1270.     Boolean                         filler1;
  1271.     RStringHandle                     errorString;                /* <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) */
  1272. };
  1273. typedef struct DETValidateSaveBlock DETValidateSaveBlock;
  1274.  
  1275. struct DETDropQueryBlock {
  1276.     DETCallFunctions                 reqFunction;                /* Requested function */
  1277.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1278.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1279.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1280.                                                                 /*    common to all invocations of code resource) */
  1281.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1282.                                                                 /*    code resource) */
  1283.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1284.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1285.     Boolean                         filler1;
  1286.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1287.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1288.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1289.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1290.     Boolean                         filler2;
  1291. };
  1292. typedef struct DETDropQueryBlock DETDropQueryBlock;
  1293.  
  1294. struct DETDropMeQueryBlock {
  1295.     DETCallFunctions                 reqFunction;                /* Requested function */
  1296.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1297.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1298.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1299.                                                                 /*    common to all invocations of code resource) */
  1300.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1301.                                                                 /*    code resource) */
  1302.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1303.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1304.     Boolean                         filler1;
  1305.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1306.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1307.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1308.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1309.     Boolean                         filler2;
  1310. };
  1311. typedef struct DETDropMeQueryBlock DETDropMeQueryBlock;
  1312.  
  1313. struct DETAttributeCreationBlock {
  1314.     DETCallFunctions                 reqFunction;                /* Requested function */
  1315.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1316.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1317.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1318.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1319.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1320.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1321.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1322.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1323.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1324. };
  1325. typedef struct DETAttributeCreationBlock DETAttributeCreationBlock;
  1326.  
  1327. struct DETAttributeNewBlock {
  1328.     DETCallFunctions                 reqFunction;                /* Requested function */
  1329.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1330.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1331.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1332.                                                                 /*    common to all invocations of code resource) */
  1333.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1334.                                                                 /*    code resource) */
  1335.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1336.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1337.     Boolean                         filler1;
  1338.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1339.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1340.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1341.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1342.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1343.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1344. };
  1345. typedef struct DETAttributeNewBlock DETAttributeNewBlock;
  1346.  
  1347. struct DETAttributeChangeBlock {
  1348.     DETCallFunctions                 reqFunction;                /* Requested function */
  1349.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1350.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1351.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1352.                                                                 /*    common to all invocations of code resource) */
  1353.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1354.                                                                 /*    code resource) */
  1355.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1356.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1357.     Boolean                         filler1;
  1358.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1359.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1360.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1361.     AttributeType                     attrType;                    /* <-> The type of the attribute being changed */
  1362.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being changed */
  1363.     AttributeCreationID             attrCID;                    /* <-> The CID of the attribute being changed */
  1364.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1365. };
  1366. typedef struct DETAttributeChangeBlock DETAttributeChangeBlock;
  1367.  
  1368. struct DETAttributeDeleteBlock {
  1369.     DETCallFunctions                 reqFunction;                /* Requested function */
  1370.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1371.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1372.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1373.                                                                 /*    common to all invocations of code resource) */
  1374.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1375.                                                                 /*    code resource) */
  1376.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1377.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1378.     Boolean                         filler1;
  1379.     PackedDSSpecPtr                 dsSpec;                        /*  -> The object which will be deleted */
  1380.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1381.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as */
  1382. };
  1383. typedef struct DETAttributeDeleteBlock DETAttributeDeleteBlock;
  1384.  
  1385. struct DETItemNewBlock {
  1386.     DETCallFunctions                 reqFunction;                /* Requested function */
  1387.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1388.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1389.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1390.                                                                 /*    common to all invocations of code resource) */
  1391.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1392.                                                                 /*    code resource) */
  1393.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1394.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1395.     Boolean                         filler1;
  1396. };
  1397. typedef struct DETItemNewBlock DETItemNewBlock;
  1398.  
  1399. struct DETShouldSyncBlock {
  1400.     DETCallFunctions                 reqFunction;                /* Requested function */
  1401.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1402.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1403.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1404.                                                                 /*    common to all invocations of code resource) */
  1405.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1406.                                                                 /*    code resource) */
  1407.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1408.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1409.     Boolean                         filler1;
  1410.     Boolean                         shouldSync;                    /* <-  True if we should now sync with catalog */
  1411.     Boolean                         filler2;
  1412. };
  1413. typedef struct DETShouldSyncBlock DETShouldSyncBlock;
  1414.  
  1415. struct DETDoSyncBlock {
  1416.     DETCallFunctions                 reqFunction;                /* Requested function */
  1417.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1418.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1419.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1420.                                                                 /*    common to all invocations of code resource) */
  1421.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1422.                                                                 /*    code resource) */
  1423.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1424.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1425.     Boolean                         filler1;
  1426. };
  1427. typedef struct DETDoSyncBlock DETDoSyncBlock;
  1428.  
  1429. struct DETPatternInBlock {
  1430.     DETCallFunctions                 reqFunction;                /* Requested function */
  1431.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1432.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1433.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1434.                                                                 /*    common to all invocations of code resource) */
  1435.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1436.                                                                 /*    code resource) */
  1437.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1438.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1439.     Boolean                         filler1;
  1440.     short                             property;                    /* The property number the call refers to */
  1441.     long                             elementType;                /*  -> Element type from pattern */
  1442.     long                             extra;                        /*  -> Extra field from pattern */
  1443.     AttributePtr                     attribute;                    /*  -> The complete attribute */
  1444.     long                             dataOffset;                    /* <-> Offset to current (next) byte */
  1445.     short                             bitOffset;                    /* <-> Bit offset (next bit is *fData >> fBitOffset++) */
  1446. };
  1447. typedef struct DETPatternInBlock DETPatternInBlock;
  1448.  
  1449. struct DETPatternOutBlock {
  1450.     DETCallFunctions                 reqFunction;                /* Requested function */
  1451.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1452.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1453.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1454.                                                                 /*    common to all invocations of code resource) */
  1455.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1456.                                                                 /*    code resource) */
  1457.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1458.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1459.     Boolean                         filler1;
  1460.     short                             property;                    /* The property number the call refers to */
  1461.     long                             elementType;                /*  -> Element type from pattern */
  1462.     long                             extra;                        /*  -> Extra field from pattern */
  1463.     AttributePtr                     attribute;                    /*  -> The attribute (minus the data portion) */
  1464.     Handle                             data;                        /*  -> Data to be written (pre-allocated, resize and add at end) */
  1465.     long                             dataOffset;                    /* <-> Offset to next byte to write */
  1466.     short                             bitOffset;                    /* <-> Bit offset (if zero, handle will need to be resized to one more byte before write) */
  1467. };
  1468. typedef struct DETPatternOutBlock DETPatternOutBlock;
  1469.  
  1470. struct DETOpenSelfBlock {
  1471.     DETCallFunctions                 reqFunction;                /* Requested function */
  1472.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1473.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1474.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1475.                                                                 /*    common to all invocations of code resource) */
  1476.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1477.                                                                 /*    code resource) */
  1478.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1479.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1480.     Boolean                         filler1;
  1481.     short                             modifiers;                    /*  -> Modifiers at open time (option/control/command/shift keys) */
  1482. };
  1483. typedef struct DETOpenSelfBlock DETOpenSelfBlock;
  1484.  
  1485. struct DETConvertToNumberBlock {
  1486.     DETCallFunctions                 reqFunction;                /* Requested function */
  1487.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1488.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1489.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1490.                                                                 /*    common to all invocations of code resource) */
  1491.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1492.                                                                 /*    code resource) */
  1493.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1494.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1495.     Boolean                         filler1;
  1496.     short                             property;                    /* The property number the call refers to */
  1497.     long                             theValue;                    /* <-  The converted value to return */
  1498. };
  1499. typedef struct DETConvertToNumberBlock DETConvertToNumberBlock;
  1500.  
  1501. struct DETConvertToRStringBlock {
  1502.     DETCallFunctions                 reqFunction;                /* Requested function */
  1503.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1504.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1505.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1506.                                                                 /*    common to all invocations of code resource) */
  1507.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1508.                                                                 /*    code resource) */
  1509.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1510.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1511.     Boolean                         filler1;
  1512.     short                             property;                    /* The property number the call refers to */
  1513.     RStringHandle                     theValue;                    /* <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) */
  1514. };
  1515. typedef struct DETConvertToRStringBlock DETConvertToRStringBlock;
  1516.  
  1517. struct DETConvertFromNumberBlock {
  1518.     DETCallFunctions                 reqFunction;                /* Requested function */
  1519.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1520.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1521.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1522.                                                                 /*    common to all invocations of code resource) */
  1523.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1524.                                                                 /*    code resource) */
  1525.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1526.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1527.     Boolean                         filler1;
  1528.     short                             property;                    /* The property number the call refers to */
  1529.     long                             theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1530. };
  1531. typedef struct DETConvertFromNumberBlock DETConvertFromNumberBlock;
  1532.  
  1533. struct DETConvertFromRStringBlock {
  1534.     DETCallFunctions                 reqFunction;                /* Requested function */
  1535.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1536.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1537.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1538.                                                                 /*    common to all invocations of code resource) */
  1539.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1540.                                                                 /*    code resource) */
  1541.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1542.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1543.     Boolean                         filler1;
  1544.     short                             property;                    /* The property number the call refers to */
  1545.     RStringPtr                         theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1546. };
  1547. typedef struct DETConvertFromRStringBlock DETConvertFromRStringBlock;
  1548.  
  1549. struct DETCustomViewDrawBlock {
  1550.     DETCallFunctions                 reqFunction;                /* Requested function */
  1551.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1552.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1553.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1554.                                                                 /*    common to all invocations of code resource) */
  1555.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1556.                                                                 /*    code resource) */
  1557.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1558.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1559.     Boolean                         filler1;
  1560.     short                             property;                    /* The property number the call refers to */
  1561. };
  1562. typedef struct DETCustomViewDrawBlock DETCustomViewDrawBlock;
  1563.  
  1564. struct DETCustomViewMouseDownBlock {
  1565.     DETCallFunctions                 reqFunction;                /* Requested function */
  1566.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1567.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1568.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1569.                                                                 /*    common to all invocations of code resource) */
  1570.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1571.                                                                 /*    code resource) */
  1572.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1573.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1574.     Boolean                         filler1;
  1575.     short                             property;                    /* The property number the call refers to */
  1576.     EventRecord *                    theEvent;                    /*  -> The original event record of the mouse-down */
  1577. };
  1578. typedef struct DETCustomViewMouseDownBlock DETCustomViewMouseDownBlock;
  1579.  
  1580. struct DETKeyPressBlock {
  1581.     DETCallFunctions                 reqFunction;                /* Requested function */
  1582.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1583.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1584.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1585.                                                                 /*    common to all invocations of code resource) */
  1586.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1587.                                                                 /*    code resource) */
  1588.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1589.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1590.     Boolean                         filler1;
  1591.     short                             property;                    /* The property number the call refers to */
  1592.     EventRecord *                    theEvent;                    /*  -> The original event record of the key-press */
  1593. };
  1594. typedef struct DETKeyPressBlock DETKeyPressBlock;
  1595.  
  1596. struct DETPasteBlock {
  1597.     DETCallFunctions                 reqFunction;                /* Requested function */
  1598.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1599.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1600.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1601.                                                                 /*    common to all invocations of code resource) */
  1602.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1603.                                                                 /*    code resource) */
  1604.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1605.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1606.     Boolean                         filler1;
  1607.     short                             property;                    /* The property number the call refers to */
  1608.     short                             modifiers;                    /*  -> Modifiers at paste time (option/control/command/shift keys) */
  1609. };
  1610. typedef struct DETPasteBlock DETPasteBlock;
  1611.  
  1612. struct DETCustomMenuSelectedBlock {
  1613.     DETCallFunctions                 reqFunction;                /* Requested function */
  1614.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1615.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1616.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1617.                                                                 /*    common to all invocations of code resource) */
  1618.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1619.                                                                 /*    code resource) */
  1620.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1621.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1622.     Boolean                         filler1;
  1623.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1624. };
  1625. typedef struct DETCustomMenuSelectedBlock DETCustomMenuSelectedBlock;
  1626.  
  1627. struct DETCustomMenuEnabledBlock {
  1628.     DETCallFunctions                 reqFunction;                /* Requested function */
  1629.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1630.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1631.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1632.                                                                 /*    common to all invocations of code resource) */
  1633.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1634.                                                                 /*    code resource) */
  1635.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1636.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1637.     Boolean                         filler1;
  1638.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1639.     Boolean                         enable;                        /* <-  Whether to enable the menu item */
  1640.     Boolean                         filler2;
  1641. };
  1642. typedef struct DETCustomMenuEnabledBlock DETCustomMenuEnabledBlock;
  1643.  
  1644. struct DETForwarderListItem {
  1645.     struct DETForwarderListItem **    next;                        /* Pointer to next item, or nil */
  1646.     AttributeTag                     attributeValueTag;            /* Tag of new templates (0 for none) */
  1647.     PackedPathName                     rstrs;                        /* Record type (empty if none), attrbute type (empty if none),list of template names to forward to */
  1648. };
  1649. typedef struct DETForwarderListItem DETForwarderListItem;
  1650.  
  1651. typedef DETForwarderListItem *            DETForwarderListPtr;
  1652. typedef DETForwarderListPtr *            DETForwarderListHandle;
  1653. struct DETDynamicForwardersBlock {
  1654.     DETCallFunctions                 reqFunction;                /* Requested function */
  1655.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1656.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1657.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1658.     DETForwarderListHandle             forwarders;                    /* <-  List of forwaders */
  1659. };
  1660. typedef struct DETDynamicForwardersBlock DETDynamicForwardersBlock;
  1661.  
  1662. struct DETDynamicResourceBlock {
  1663.     DETCallFunctions                 reqFunction;                /* Requested function */
  1664.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1665.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1666.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1667.                                                                 /*    common to all invocations of code resource) */
  1668.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1669.                                                                 /*    code resource) */
  1670.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1671.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1672.     Boolean                         filler1;
  1673.     ResType                         resourceType;                /*  -> The resource type being requested */
  1674.     short                             propertyNumber;                /*  -> The property number of the resource being requested */
  1675.     short                             resourceID;                    /*  -> The resource ID (base ID + property number) of the resource */
  1676.     Handle                             theResource;                /* <-  The requested resource */
  1677. };
  1678. typedef struct DETDynamicResourceBlock DETDynamicResourceBlock;
  1679.  
  1680.  
  1681. union DETCallBlock {
  1682.     DETProtoCallBlock                 protoCall;
  1683.     DETInitBlock                     init;
  1684.     DETExitBlock                     exit;
  1685.     DETInstanceInitBlock             instanceInit;
  1686.     DETInstanceExitBlock             instanceExit;
  1687.     DETInstanceIdleBlock             instanceIdle;
  1688.     DETPropertyCommandBlock         propertyCommand;
  1689.     DETMaximumTextLengthBlock         maximumTextLength;
  1690.     DETViewListChangedBlock         viewListChanged;
  1691.     DETPropertyDirtiedBlock         propertyDirtied;
  1692.     DETValidateSaveBlock             validateSave;
  1693.     DETDropQueryBlock                 dropQuery;
  1694.     DETDropMeQueryBlock             dropMeQuery;
  1695.     DETAttributeCreationBlock         attributeCreationBlock;
  1696.     DETAttributeNewBlock             attributeNew;
  1697.     DETAttributeChangeBlock         attributeChange;
  1698.     DETAttributeDeleteBlock         attributeDelete;
  1699.     DETItemNewBlock                 itemNew;
  1700.     DETPatternInBlock                 patternIn;
  1701.     DETPatternOutBlock                 patternOut;
  1702.     DETShouldSyncBlock                 shouldSync;
  1703.     DETDoSyncBlock                     doSync;
  1704.     DETOpenSelfBlock                 openSelf;
  1705.     DETConvertToNumberBlock         convertToNumber;
  1706.     DETConvertToRStringBlock         convertToRString;
  1707.     DETConvertFromNumberBlock         convertFromNumber;
  1708.     DETConvertFromRStringBlock         convertFromRString;
  1709.     DETCustomViewDrawBlock             customViewDraw;
  1710.     DETCustomViewMouseDownBlock     customViewMouseDown;
  1711.     DETKeyPressBlock                 keyPress;
  1712.     DETPasteBlock                     paste;
  1713.     DETCustomMenuSelectedBlock         customMenuSelected;
  1714.     DETCustomMenuEnabledBlock         customMenuEnabled;
  1715.     DETDynamicForwardersBlock         dynamicForwarders;
  1716.     DETDynamicResourceBlock         dynamicResource;
  1717. };
  1718.  
  1719. enum { uppDETCallBackProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  1720. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)  CALL_TWO_PARAMETER_UPP((userRoutine), uppDETCallBackProcInfo, (callBlockPtr), (callBackBlockPtr))
  1721. #define NewDETCallBackProc(userRoutine)                         (DETCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallBackProcInfo, GetCurrentArchitecture())
  1722. /* Call-for list: */
  1723.  
  1724. enum {
  1725.     kDETCallForOther            = 1,                            /* Call for things not listed below (also auto-enabled by DE if any of the below are enabled) */
  1726.     kDETCallForIdle                = 2,                            /* kDETcmdIdle */
  1727.     kDETCallForCommands            = 4,                            /* kDETcmdPropertyCommand, kDETcmdSelfOpen */
  1728.     kDETCallForViewChanges        = 8,                            /* kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength */
  1729.     kDETCallForDrops            = 0x10,                            /* kDETcmdDropQuery, kDETcmdDropMeQuery */
  1730.     kDETCallForAttributes        = 0x20,                            /* kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete */
  1731.     kDETCallForValidation        = 0x40,                            /* kDETcmdValidateSave */
  1732.     kDETCallForKeyPresses        = 0x80,                            /* kDETcmdKeyPress and kDETcmdPaste */
  1733.     kDETCallForResources        = 0x0100,                        /* kDETcmdDynamicResource */
  1734.     kDETCallForSyncing            = 0x0200,                        /* kDETcmdShouldSync, kDETcmdDoSync */
  1735.     kDETCallForEscalation        = 0x8000,                        /* All calls escalated from the next lower level */
  1736.     kDETCallForNothing            = 0,                            /* None of the above */
  1737.     kDETCallForEverything        = (long)0xFFFFFFFF                /* All of the above */
  1738. };
  1739.  
  1740. typedef CALLBACK_API( OSErr , DETCallProcPtr )(DETCallBlockPtr callBlockPtr);
  1741. typedef STACK_UPP_TYPE(DETCallProcPtr)                             DETCallUPP;
  1742. enum { uppDETCallProcInfo = 0x000000E0 };                         /* pascal 2_bytes Func(4_bytes) */
  1743. #define NewDETCallProc(userRoutine)                             (DETCallUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallProcInfo, GetCurrentArchitecture())
  1744. #define CallDETCallProc(userRoutine, callBlockPtr)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppDETCallProcInfo, (callBlockPtr))
  1745. typedef DETCallUPP                         DETCall;
  1746. /* This following macro saves you from having to dig out the call-back pointer from the call block: */
  1747. #define CallBackDET(callBlockPtr, callBackBlockPtr) CallDETCallBackProc(callBlockPtr->protoCall.callBack,callBlockPtr,callBackBlockPtr)
  1748. #endif /* REZ */
  1749.  
  1750. /************************************************************************************/
  1751. /********************************* SAM Definitions: *********************************/
  1752. /************************************************************************************/
  1753.  
  1754. /* SAM Developers should use property numbers starting at this point: */
  1755. #define kSAMFirstDevProperty                kDETFirstDevProperty + 10
  1756.  
  1757.  
  1758. /*
  1759.     SAM templates have additional resources/properties that are required
  1760.     for interaction with the AOCE Key Chain.
  1761.     
  1762.      Type    Offset                        Description
  1763.      ----    ------                        -----------
  1764.     'rstr'    kSAMAspectUserName            The user name
  1765.     'rstr'    kSAMAspectKind                The kind of SAM
  1766.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1767.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1768. */
  1769.  
  1770. #define kSAMAspectUserName                        kDETFirstDevProperty + 1
  1771. #define kSAMAspectKind                            kDETFirstDevProperty + 2
  1772. #define kSAMAspectCannotDelete                    kDETFirstDevProperty + 3
  1773. #define kSAMAspectSlotCreationInfo                kDETFirstDevProperty + 4
  1774.  
  1775. /**************************************************************************************
  1776.  ********************************* Admin Definitions: *********************************
  1777.  **************************************************************************************/
  1778.  
  1779. #define kDETAdminVersion         -978
  1780.  
  1781.  
  1782.  
  1783. #ifndef REZ
  1784.  
  1785. #endif /* REZ */
  1786.  
  1787. #if PRAGMA_STRUCT_ALIGN
  1788.     #pragma options align=reset
  1789. #elif PRAGMA_STRUCT_PACKPUSH
  1790.     #pragma pack(pop)
  1791. #elif PRAGMA_STRUCT_PACK
  1792.     #pragma pack()
  1793. #endif
  1794.  
  1795. #ifdef PRAGMA_IMPORT_OFF
  1796. #pragma import off
  1797. #elif PRAGMA_IMPORT
  1798. #pragma import reset
  1799. #endif
  1800.  
  1801. #ifdef __cplusplus
  1802. }
  1803. #endif
  1804.  
  1805. #endif /* __OCETEMPLATES__ */
  1806.  
  1807.